package cn.iocoder.yudao.module.member.api.banner;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.member.api.banner.dto.BannerPageReqDTO;
import cn.iocoder.yudao.module.member.api.banner.dto.BannerRespDTO;
import cn.iocoder.yudao.module.member.controller.admin.banner.vo.BannerPageReqVO;
import cn.iocoder.yudao.module.member.convert.banner.BannerConvert;
import cn.iocoder.yudao.module.member.dal.dataobject.banner.BannerDO;
import cn.iocoder.yudao.module.member.service.banner.BannerService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;

import javax.annotation.Resource;

@Service
@Validated
public class BannerApiImpl implements BannerApi{
    @Resource
    private BannerService bannerService;
    @Override
    public PageResult<BannerRespDTO> getBannerPage(BannerPageReqDTO pageVO) {
        BannerPageReqVO  bannerPageReqVO=new BannerPageReqVO();
        BeanUtils.copyProperties(pageVO,bannerPageReqVO);
        PageResult<BannerDO> bannerDOPageResult=bannerService.getBannerPage(bannerPageReqVO);
        return BannerConvert.INSTANCE.convertPage1(bannerDOPageResult);
    }
}
